package com.woniu40.petai_user.interceptors;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class PermissionIntercepter implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        /*String path = request.getServletPath();
        if(path.contains("login")||path.contains("reg")){
            return true;
        }
        Object userInfo = request.getSession().getAttribute("userInfo");
        if(userInfo==null){
            request.setAttribute("errorInfo","请先登录！");
            request.getRequestDispatcher("/").forward(request,response);
            return false;
        }*/
        return true;
    }
}
